package com.example.netty.wechat;


import com.alibaba.fastjson.JSON;
import org.springframework.util.StringUtils;

/**
 * TODO: 这里要写注释的!
 */
public class Request {
    private boolean isSucc= true;
    private String requestId;
    private Long serviceId;
    private String name;
    private String message;
    public String groupName;//群名称
    public TalkType type;//类型：点点
    public String targetId;//p2p时候接收端id

    public static Request create(String text){
        if(!StringUtils.isEmpty(text)){
            return JSON.parseObject(text, Request.class);
        }
        return new Request();
    }

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public Long getServiceId() {
        return serviceId;
    }

    public void setServiceId(Long serviceId) {
        this.serviceId = serviceId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public boolean getIsSucc() {
        return isSucc;
    }

    public void setIsSucc(boolean isSucc) {
        this.isSucc = isSucc;
    }

    public String toJson(){
        return JSON.toJSONString(this);
    }
}
